﻿using System;

namespace Teigha.Core
{
	public class OdGiContext_Internal : OdGiContext
	{
		public OdGiContext_Internal(IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
		{
		}

		public override OdRxObject database()
		{
			IntPtr cPtr = GlobalsPINVOKE.OdGiContext_database(OdGiContext.getCPtr(this));
			return new OdRxObject(cPtr, false);
		}

		public override OdGiDrawable openDrawable(OdDbStub drawableId)
		{
			IntPtr cPtr = GlobalsPINVOKE.OdGiContext_openDrawable(OdGiContext.getCPtr(this), OdDbStub.getCPtr(drawableId));
			OdGiDrawable result = new OdGiDrawable_Internal(cPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}
	}
}
